require('./index.scss');
var template = require('./template.html');

var comp = avalon.component('ms-pagination', {
    template: template,
    defaults: {
        totalPage:0,
        curr:0,
        first:1,
        jump:function(){},
        onReady:function(e){
            var that = this;
            that.$element.id = that.$id;
            console.log('pagination this',this);
            that.$watch('totalPage',function(newval){
                laypage({
                    cont: that.$id,
                    first: that.first,
                    last: that.totalPage,
                    prev: '上一页',
                    next: '下一页',
                    groups:5,
                    skip: true,
                    pages: that.totalPage,
                    curr: that.curr,
                    jump: function(obj){
                        that.jump(obj);
                    }
                })
            });
            
        }
    }
});
module.exports = comp;